﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin1/SiteAdmin.master" AutoEventWireup="true" CodeFile="Flashbanner.aspx.cs" Inherits="admin1_Flashbanner" %>

<%@ Register Assembly="CKFinder" Namespace="CKFinder" TagPrefix="CKFinder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../ckeditor/ckeditor.js"></script>
    <script src="../ckfinder/ckfinder.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#add_category").click(function () {
                $("#add_cate").slideDown("slow");
                $(".null").val('');
            });
            $(".icon1").click(function () {
                $("#add_cate").slideUp();
            });
            $(".icon1").click(function () {
                $("#edit_cate").slideUp();
            });
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">

    <%--  box add Product--%>
    <asp:Panel ID="panel_Add" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_ClosAdd" runat="server" OnClick="lbt_ClosAdd_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Thêm Flash Banner</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Chọn tour</label>
                        <div class="controls">
                            <div class="ctr">
                                <div class="rw">
                                    <asp:DropDownList ID="ddlproductId" runat="server"></asp:DropDownList>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Image</label>
                        <div class="controls">
                            <div class="ctr">
                                   <asp:TextBox ID="Images2" runat="server" Width="500"></asp:TextBox>
                                <input id="Browser2" value="Browser Images" type="button" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="Images2" style="color:red;"  runat="server" ErrorMessage="Chọn ảnh "></asp:RequiredFieldValidator>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Trạng thái</label>
                        <div class="controls">

                            <asp:RadioButtonList ID="radAdd" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Selected="True" Value="True">Hiện</asp:ListItem>
                                <asp:ListItem Value="False">Ẩn</asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btnInsert" runat="server" Text="Save" class="btn btn-success" OnClick="btnInsert_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>

    <%-- Box Edit flash banner--%>
    <asp:Panel ID="panel_Edit" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_ClosEdit" runat="server" OnClick="lbt_ClosEdit_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Thêm Flash Banner</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Mã</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_BannerId_Edit" CssClass="NameEdit" runat="server" Enabled="False"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Chọn tour</label>
                        <div class="controls">
                            <div class="ctr">
                                <div class="rw">
                                    <asp:DropDownList ID="ddl_Tour_Edit" runat="server"></asp:DropDownList>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Ảnh cũ</label>
                        <div class="controls">
                            <asp:Image ID="Image1" runat="server" Width="486" Height="117" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Ảnh mới</label>
                        <div class="controls">
                                <asp:TextBox ID="Images" runat="server"  Width="500" ></asp:TextBox>
                                <input id="Browser" value="Browser Images" type="button" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Trạng thái</label>
                        <div class="controls">
                            <asp:RadioButtonList ID="radEdit" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Selected="True" Value="True">Hiện</asp:ListItem>
                                <asp:ListItem Value="False">Ẩn</asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btn_Save_Edit" runat="server" Text="Save" class="btn btn-success" OnClick="btn_Save_Edit_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>

    <%-- box Flash banner--%>
    <div class="row-fluid" style="margin-top: 10px;">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <asp:LinkButton ID="lbt_Add_New" runat="server" OnClick="lbt_Add_New_Click"><img src="img/icons/16/add.png"  width="34" /></asp:LinkButton>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                            <tr>
                                <th>Mã</th>
                                <th>Ảnh</th>
                                <th>Mã tour</th>
                                <th>Trạng thái</th>
                                <th>Chức năng</th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Repeater ID="rpt_flash" runat="server">
                                <ItemTemplate>
                                    <tr class="gradeX">
                                        <td class="center"><%#Eval("BannerId") %></td>
                                        <td class="center">
                                            <img style="width: 486px; height: 117px;" class="img_prod" src="<%#Eval("image") %>" /></td>
                                        <td class="center"><%#Eval("TourId")%></td>
                                        <td class="center"><%#bool.Parse(Eval("Activated").ToString())?"Hiện":"Ẩn" %></td>
                                        <td class="center">
                                            <asp:LinkButton ID="lbt_ChinhSua" CommandArgument='<%#Eval("BannerId") %>' runat="server" OnClick="lbt_ChinhSua_Click" ToolTip="Chỉnh Sửa"><img src="img/icons/16/create.png" width="16" height="18"/></asp:LinkButton>
                                            &nbsp;&nbsp;<asp:LinkButton ID="btnxoa" CommandArgument='<%#Eval("BannerId") %>' runat="server" ToolTip="Xóa" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');" OnClick="btnxoa_Click"><img src="img/icons/16/delete.png" width="16" height="18"/></asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#Browser").click(function () {
                //alert();
                var ckfinder = new CKFinder();
                ckfinder.selectActionFunction = function (fileUrl) {
                    $("#body_Images").val(fileUrl);
                };
                ckfinder.popup();
            });
            $("#Browser2").click(function () {
                //alert();
                var ckfinder = new CKFinder();
                ckfinder.selectActionFunction = function (fileUrl) {
                    $("#body_Images2").val(fileUrl);
                };
                ckfinder.popup();
            });
        });

    </script>
</asp:Content>

